﻿using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using MauiApp5.Models;
using Microsoft.Maui;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MauiApp5.ViewModels
{
    partial class UserXViewModels: ObservableObject
    {
        [ObservableProperty]
        private bool isLiked;

        [ObservableProperty]
        private double titleBarColor = 0;

        [ObservableProperty]
        private string introduction;


        public ObservableCollection<BasicInfo> BasicInfoList { get; set; }

        public ObservableCollection<UserPhoto> UserPhotos { get; set; }

        public ObservableCollection<UserHobby> UserHobbies { get; set; }

        public ObservableCollection<RecentActivity> RecentActivities { get; set; }
        [ObservableProperty]
        private bool isTitleBarVisible = false;


        public UserXViewModels()
        {
            BasicInfoList = new ObservableCollection<BasicInfo>();
            BasicInfoList.Add(new BasicInfo
            {
                Title = "身高",
                Icon = "\xe60a",
                Value = "165Cm"
            });
            BasicInfoList.Add(new BasicInfo
            {
                Title = "体重",
                Icon = "\xe696",
                Value = "55Kg"
            });
            BasicInfoList.Add(new BasicInfo
            {
                Title = "星座",
                Icon = "\xe601",
                Value = "狮子座"
            });
            BasicInfoList.Add(new BasicInfo
            {
                Title = "现居住地",
                Icon = "\xe652",
                Value = "现居住安阳"
            });
            BasicInfoList.Add(new BasicInfo
            {
                Title = "工作",
                Icon = "\xe656",
                Value = "政府机关"
            });

            UserPhotos = new ObservableCollection<UserPhoto>();
            UserPhotos.Add(new UserPhoto
            {
                Id = 1,
                ImageUrl = "https://img1.doubanio.com/view/personage/m/public/2de309f951c12df28dc9d1dfb424e719.jpg"
            });

            UserHobbies = new ObservableCollection<UserHobby>
            {
                new UserHobby { Id = 1, HobbyName = "美食" },
                new UserHobby { Id = 2, HobbyName = "王者荣耀" },
                new UserHobby { Id = 3, HobbyName = "撸猫" }
                
            };

            RecentActivities = new ObservableCollection<RecentActivity>
            {
                new RecentActivity { Date = DateTime.Now, Content = "Went hiking in the mountains.", ImageUrl = "https://img1.baidu.com/it/u=747569475,222214059&fm=253&fmt=auto&app=138&f=JPEG" },
                new RecentActivity { Date = DateTime.Now.AddDays(-1), Content = "Visited a new restaurant.", ImageUrl = "https://q9.itc.cn/images01/20241103/1303ea77f0c644c59e078a833e348bf2.jpeg" }
            };

            Introduction = "我出生在广东，现在工作和居住均在广州，毕业于广东财经大学，目前于某银行从事运营工作。性格能动能静，宅在家里的时候喜欢看看电影，撸猫，周末有空时候喜欢约上朋友到处探店或者运动，喜欢旅行，对新鲜事务保持好奇心。热爱生活。";

        }


        [RelayCommand]  
        async void Back()
        {
            await Shell.Current.GoToAsync("//shouye");
        }
        [RelayCommand]
        public void ToggleLike()
        {
            IsLiked = !IsLiked;
        }
        [RelayCommand]
        async void GotoRecentActivity()
        {
            await Shell.Current.GoToAsync("RecentActivityPage");
        }
        [RelayCommand]
        async void GotoMessagePage()
        {
            
            await Shell.Current.GoToAsync("//xiaoxi");
        }

    }
}
